package com.wushijia.highconcurrency.thread;

public class InterruptTest {

  public static void main(String[] args) throws InterruptedException {
    Thread thread = new Thread() {
      @Override
      public void run() {
        do {
          System.out.println("Interrupted");
          break;
        } while (Thread.currentThread().isInterrupted());
      }
    };
    thread.start();
    Thread.sleep(2000);
    thread.interrupt();
  }
}
